import { RouteRecordRaw } from 'vue-router'
import LoginPage from 'pages/LoginPage.vue'
import BasicLayout from 'layouts/BasicLayout.vue'
import { HOME_ROUTE_NAME, LOGIN_ROUTE_NAME } from 'utils/SystemConstants'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    name: HOME_ROUTE_NAME,
    redirect: '/index',
  },
  {
    path: '/login',
    name: LOGIN_ROUTE_NAME,
    component: LoginPage,
  },
  {
    path: '/index',
    component: BasicLayout,
    redirect: '/index/home',
    children: [
      {
        path: 'home',
        name: 'HomePage',
        component: () => import('pages/HomePage.vue'),
      },
      {
        path: 'form/json-form',
        name: 'JsonFormPage',
        component: () => import('pages/all-demo/form-demo/JsonFormPage.vue'),
      },
      {
        path: 'form/el-form',
        name: 'ElFormPage',
        component: () => import('pages/all-demo/form-demo/ElFormPage.vue'),
      },
    ],
  },
  {
    path: '/demo/pinia',
    component: () => import('pages/demo/PiniaHello.vue'),
  },
  {
    path: '/demo/use-request',
    component: () => import('pages/demo/UseRequestHello.vue'),
  },
  {
    path: '/demo/element-plus',
    name: 'ElementPlus',
    component: () => import('pages/demo/ElementPlusHello.vue'),
  },
  {
    path: '/demo/map-factory',
    component: () => import('pages/demo/MapFactoryHello.vue'),
  },
]

export default routes
